#!/bin/sh

if [ "$1" = "help" ]; then
    echo "*** Description ***" 
    echo "Prints weather forcast from wttr.in; defaults to O'Fallon, MO"
    echo ""
    echo "*** Usage ***"
    echo "wttr [full]"
    echo ""
    echo "*** Parameters ***"
    echo ""
    echo "*** Options ***"
    echo "full: Outputs full forcast from wttr.in"
    echo ""
    exit 0
fi

wget -q --spider http://gnu.org

if [ $? = 0 ]; then
    if [ "$1" = "full" ]; then
        curl -s wttr.in/OFallon
    else
        curl -s "wttr.in/OFallon?0"
    fi
else
    exit 1
fi
